function handleRegister() {
    let username = u.value;
    let name = n.value;

    $.ajax({
        url: '/user/registerCheck',
        data: { username, name },
        success(r) {
            if (r == -1) {
                alert('账号已注册');
            } else {
                alert('注册成功！');
                location.href = '/login';
            }
        },
    });
}